package com.amazon.ags.jni.achievements;

import android.util.Log;
import com.amazon.ags.api.AGResponseHandle;
import com.amazon.ags.api.AmazonGamesClient;
import com.amazon.ags.api.RequestResponse;
import com.amazon.ags.api.achievements.AchievementsClient;
import com.amazon.ags.api.achievements.GetAchievementResponse;
import com.amazon.ags.api.achievements.GetAchievementsResponse;
import com.amazon.ags.api.achievements.UpdateProgressResponse;

public class AchievementsNativeHandler
{
  private static String TAG = "AchievementsNativeHandler";
  private static AchievementsClient m_AchievementsClient = null;

  public static void initializeNativeHandler(AmazonGamesClient paramAmazonGamesClient)
  {
    m_AchievementsClient = paramAmazonGamesClient.getAchievementsClient();
  }

  public static void requestAchievement(String paramString, int paramInt, long paramLong)
  {
    if (m_AchievementsClient == null)
    {
      Log.e(TAG, "requestAchievement - initializeJni was not called beforehand.");
      return;
    }
    m_AchievementsClient.getAchievement(paramString, new Object[0]).setCallback(new GetAchievementJniRespHandler(paramInt, paramLong));
  }

  public static AGResponseHandle<GetAchievementResponse> requestAchievementHandle(String paramString, int paramInt)
  {
    if (m_AchievementsClient == null)
    {
      Log.e(TAG, "requestAchievementHandle - initializeJni was not called beforehand.");
      return null;
    }
    AchievementsClient localAchievementsClient = m_AchievementsClient;
    Object[] arrayOfObject = new Object[1];
    arrayOfObject[0] = Integer.valueOf(paramInt);
    return localAchievementsClient.getAchievement(paramString, arrayOfObject);
  }

  public static void requestAchievements(int paramInt, long paramLong)
  {
    if (m_AchievementsClient == null)
    {
      Log.e(TAG, "requestAchievements - initializeJni was not called beforehand.");
      return;
    }
    m_AchievementsClient.getAchievements(new Object[0]).setCallback(new GetAchievementsJniRespHandler(paramInt, paramLong));
  }

  public static AGResponseHandle<GetAchievementsResponse> requestAchievementsHandle(int paramInt)
  {
    if (m_AchievementsClient == null)
    {
      Log.e(TAG, "requestAchievementsHandle - initializeJni was not called beforehand.");
      return null;
    }
    AchievementsClient localAchievementsClient = m_AchievementsClient;
    Object[] arrayOfObject = new Object[1];
    arrayOfObject[0] = Integer.valueOf(paramInt);
    return localAchievementsClient.getAchievements(arrayOfObject);
  }

  public static void resetAchievement(String paramString, int paramInt, long paramLong)
  {
    if (m_AchievementsClient == null)
    {
      Log.e(TAG, "resetAchievement - initializeJni was not called beforehand.");
      return;
    }
    m_AchievementsClient.resetAchievement(paramString, new Object[0]).setCallback(new ResetAchievementJniRespHandler(paramInt, paramLong));
  }

  public static AGResponseHandle<RequestResponse> resetAchievementHandle(String paramString, int paramInt)
  {
    if (m_AchievementsClient == null)
    {
      Log.e(TAG, "resetAchievementHandle - initializeJni was not called beforehand.");
      return null;
    }
    AchievementsClient localAchievementsClient = m_AchievementsClient;
    Object[] arrayOfObject = new Object[1];
    arrayOfObject[0] = Integer.valueOf(paramInt);
    return localAchievementsClient.resetAchievement(paramString, arrayOfObject);
  }

  public static void resetAchievements(int paramInt, long paramLong)
  {
    if (m_AchievementsClient == null)
    {
      Log.e(TAG, "resetAchievements - initializeJni was not called beforehand.");
      return;
    }
    m_AchievementsClient.resetAchievements(new Object[0]).setCallback(new ResetAchievementJniRespHandler(paramInt, paramLong));
  }

  public static AGResponseHandle<RequestResponse> resetAchievementsHandle(int paramInt)
  {
    if (m_AchievementsClient == null)
    {
      Log.e(TAG, "resetAchievementsHandle - initializeJni was not called beforehand.");
      return null;
    }
    AchievementsClient localAchievementsClient = m_AchievementsClient;
    Object[] arrayOfObject = new Object[1];
    arrayOfObject[0] = Integer.valueOf(paramInt);
    return localAchievementsClient.resetAchievements(arrayOfObject);
  }

  public static AGResponseHandle<RequestResponse> showAchievementsOverlay()
  {
    if (m_AchievementsClient == null)
    {
      Log.e(TAG, "showAchievementsOverlay - initializeJni was not called beforehand.");
      return null;
    }
    return m_AchievementsClient.showAchievementsOverlay(new Object[0]);
  }

  public static void updateProgress(String paramString, float paramFloat, int paramInt, long paramLong)
  {
    if (m_AchievementsClient == null)
    {
      Log.e(TAG, "updateProgress - initializeJni was not called beforehand.");
      return;
    }
    m_AchievementsClient.updateProgress(paramString, paramFloat, new Object[0]).setCallback(new UpdateProgressJniRespHandler(paramString, paramInt, paramLong));
  }

  public static AGResponseHandle<UpdateProgressResponse> updateProgressHandle(String paramString, float paramFloat, int paramInt)
  {
    if (m_AchievementsClient == null)
    {
      Log.e(TAG, "updateProgressHandle - initializeJni was not called beforehand.");
      return null;
    }
    AchievementsClient localAchievementsClient = m_AchievementsClient;
    Object[] arrayOfObject = new Object[1];
    arrayOfObject[0] = Integer.valueOf(paramInt);
    return localAchievementsClient.updateProgress(paramString, paramFloat, arrayOfObject);
  }
}

/* Location:           E:\android\Toy Defense 2_dex2jar.jar
 * Qualified Name:     com.amazon.ags.jni.achievements.AchievementsNativeHandler
 * JD-Core Version:    0.6.2
 */